#include<stdio.h>
#include<fcntl.h>
#include<errno.h>
#include<unistd.h>
#include<sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
#include <stdlib.h>

#define PAGE_SIZE (4*1024)
#define BUF_SIZE (1*PAGE_SIZE)
#define OFFSET (0*PAGE_SIZE)

int main(int argc, const char *argv[])
{
    int fd;
    char *addr = NULL;

    fd = open("/dev/mmap_interface", O_RDWR);
	if(fd < 0){
		printf("failed!\n");
	}

    addr = mmap(NULL, BUF_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED , fd, OFFSET);
    printf("0x%lx\n", *(int *)addr);

    return 0;
}